import request from '@/utils/request'

// 查询采购分配触发列表
export function listTrigger(query) {
  return request({
    url: '/productAllocation/triggerAll/listAll',
    method: 'get',
    params: query
  })
}
// 查询采购分配触发列表
export function numbers(query) {
  return request({
    url: '/productAllocation/trigger/numbers',
    method: 'get',
    params: query
  })
}
// 查询采购分配触发列表
export function selectlist(query) {
  return request({
    url: '/productAllocation/trigger/list',
    method: 'get',
    params: query
  })
}
// 查询采购分配触发列表
export function listBySku(query) {
  return request({
    url: '/productAllocation/trigger/listBySku',
    method: 'get',
    params: query
  })
}
// 查询采购分配触发详细
export function getTrigger(id) {
  return request({
    url: '/productAllocation/trigger/' + id,
    method: 'get'
  })
}

// 新增采购分配触发
export function syncTriggerTables(data) {
  return request({
    url: '/productAllocation/trigger/syncTriggerTables',
    method: 'post',
    data: data
  })
}
// 新增采购分配触发
export function processandinsert(data) {
  return request({
    url: '/productAllocation/trigger/process-and-insert',
    method: 'post',
    data: data
  })
}
// 新增采购分配触发
export function addTrigger(data) {
  return request({
    url: '/productAllocation/trigger',
    method: 'post',
    data: data
  })
}
// 新增采购分配触发
export function triggerByPurchaseNum(data) {
  return request({
    url: '/productAllocation/trigger/triggerByPurchaseNum',
    method: 'post',
    data: data
  })
}
export function updateByStrategyCode(data) {
  return request({
    url: '/productAllocation/relation/updateByStrategyCode',
    method: 'post',
    data: data
  })
}
// 修改采购分配触发
export function updateTrigger(data) {
  return request({
    url: '/productAllocation/trigger',
    method: 'put',
    data: data
  })
}

// 删除采购分配触发
export function delTrigger(id) {
  return request({
    url: '/productAllocation/trigger/' + id,
    method: 'delete'
  })
}
